<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <div class="section">
                <h1>Pesquisando</h1>
                <h:form id="formCustomer">
                    <p:growl id="msg" life="3000"/>
                    <div class="container_24 clearfix">
                        <p:panel header="Filtros">
                            <f:validateBean disabled="true" >
                                <p:outputLabel value="CPF:" styleClass="grid_3" />
                                <p:inputMask mask="999.999.999-99" value="#{managerSearchCustomer.customer.cpf}"  
                                             styleClass="grid_8" />
                                <div class="clear-both"/>
                                <p:outputLabel value="Nome:" styleClass="grid_3" />
                                <p:inputText value="#{managerSearchCustomer.customer.name}" styleClass="grid_18" />
                            </f:validateBean>
                            <div class="clear" />
                        </p:panel>

                        <div class="buttonAction">
                            <p:commandButton value="Pesquisar"
                                             actionListener="#{managerSearchCustomer.searchCustomer()}"
                                             update="@form, tableCustomer"
                                             icon="ui-icon-search"/>
                            <p:commandButton value="Limpar" icon="ui-icon-close" actionListener="#{managerSearchCustomer.clean()}" process="@this" update="@form"/>

                        </div>

                        <p:dataTable id="tableCustomer" var="c" value="#{managerSearchCustomer.customers}" 
                                     styleClass="grid_24"
                                     rowIndexVar="rowid"
                                     rows="5" paginator="true"  
                                     paginatorPosition="bottom"
                                     emptyMessage="Nenhum registro">  
                            <f:facet name="header">
                                Clientes
                            </f:facet>
                            <p:column headerText="Nome" width="600">  
                                <h:outputText value="#{c.name}"/>
                            </p:column>  
                            <p:column headerText="Cpf">  
                                <h:outputText value="#{c.cpf}"/>
                            </p:column>

                            <p:column headerText="Ação" width="75">

                                <p:button  style="width: 20px; height: 20px;" 
                                           title="editar" icon="ui-icon-pencil"
                                           href="editcustomer.xhtml?eCustomer=#{c.id}" />
                                <p:button  style="width: 20px; height: 20px;" 
                                           title="editar" icon="ui-icon-zoomin"
                                           href="viewcustomer.xhtml?sCustomer=#{c.id}" />
                                
                              
                            </p:column>
                        </p:dataTable> 


                    </div>
                </h:form>
            </div>
        </ui:define>
    </ui:composition>

</html>
